import java.util.*;

public class CalendarSeeker {
	public static void main (String[] args)
	{
		System.out.println("Enter date in format \"10 October 2010\"");
		Scanner i= new Scanner(System.in);
		int day = i.nextInt();
		String month=i.next();
		int monthNumber=returnNumberOfMonth(month);
		int year = i.nextInt();
		i.close();
		int a = (14-monthNumber) / 12;
		int y = year-a;
		int m = monthNumber+12*a-2;
		int dayOfWeek = (7000 + (day + y + y / 4 - y / 100 + y / 400 + (31 * m) / 12))%7;
		System.out.println(returnDay(dayOfWeek));
	}
		private static int returnNumberOfMonth(String month){
			int monthNumber=0;
			switch (month){
			case "January":
				monthNumber=1;
				break;
			case "February":
				monthNumber=2;
				break;
			case "March":
				monthNumber=3;
				break;
			case "April":
				monthNumber=4;
				break;
			case "May":
				monthNumber=5;
				break;
			case "June":
				monthNumber=6;
				break;
			case "July":
				monthNumber=7;
				break;
			case "August":
				monthNumber=8;
				break;
			case "September":
				monthNumber=9;
				break;
			case "October":
				monthNumber=10;
				break;
			case "November":
				monthNumber=11;
				break;
			case "December":
				monthNumber=12;
				break;
			}
			return monthNumber;
			}
		private static String returnDay(int dayOfWeek){
			String day=new String();
			switch (dayOfWeek){
			case 0:
				day="Sunday";
				break;
			case 1:
				day="Monday";
				break;
			case 2:
				day="Tuesday";
				break;
			case 3:
				day="Wednesday";
				break;
			case 4:
				day="Thursday";
				break;
			case 5:
				day="Friday";
				break;
			case 6:
				day="Saturday";
				break;
		}
			return day;
		}
}
